package com.chenyue.cm.user.service.impl;


import java.io.Serializable;
import java.util.Date;

import javax.annotation.Resource;

import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chenyue.cm.base.service.BaseServiceImpl;
import com.chenyue.cm.base.dao.LcBaseMapper;
import com.chenyue.cm.common.utils.StringUtil;
import com.chenyue.cm.utils.DateUtils;
import org.springframework.beans.factory.annotation.Qualifier;
import com.chenyue.cm.user.dao.JdOrderLogMapper;
import com.chenyue.cm.user.domain.JdOrderLog;
import com.chenyue.cm.user.service.JdOrderLogService;
import org.springframework.stereotype.Service;


/**
*
* @author chenyue-cm
*/
@Service(value = "JdOrderLogService")
public class JdOrderLogServiceImpl extends BaseServiceImpl<JdOrderLog>  implements JdOrderLogService {

private final JdOrderLogMapper jdOrderLogMapper;

	public JdOrderLogServiceImpl(@Qualifier("jdOrderLogMapper") JdOrderLogMapper jdOrderLogMapper) {
		this.jdOrderLogMapper = jdOrderLogMapper;
	}

	@Override
	@Resource(name = "jdOrderLogMapper")
	public void setBaseMapper(LcBaseMapper<JdOrderLog, Serializable> baseMapper) {
		this.baseMapper = baseMapper;
	}

	@Override
	public void savaOrderLog(String orderId, String id, String orderType, int orderLogType) {
		JdOrderLog orderLog = new JdOrderLog();
		orderLog.setId(StringUtil.getUuid());
		orderLog.setOrderId(orderId);  //订单id
		orderLog.setMemberId(id);  //用户id
		orderLog.setCreateUser(id);
		orderLog.setCreateTime(DateUtils.getCurrentTime());
		orderLog.setLogType(orderLogType);  //订单日志类型
		orderLog.setOrderType(orderType);  //订单类型
		jdOrderLogMapper.insert(orderLog);
	}
}
